<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'name' => '后台系统',
    'charset' => 'utf-8',
    'language' => 'zh-CN',
    'timeZone' => 'Asia/Shanghai',
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'id' => 'app-backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'defaultRoute' => 'home/index',
    'modules' => [
//        'modules' => [
//            'defaultAction' => ''
//        ],
        'gii' => [
            'class' => 'yii\gii\Module',
            'allowedIPs' => ['127.0.0.1','::1'],
        ]
    ],

//    'as access' => [
//        'class' => 'common\core\AccessControl',
//        'is_debug' => false,
//        'allowActions' => [
//            '/site/login',
//        ]
//    ],

    'components' => [

//        'cache' => [
//            'class' => 'yii\caching\FileCache',
//        ],

        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'enableStrictParsing' => false,//是否区分大小写
            'rules' => [

            ],
        ],

        'user' => [
            'class' => 'common\core\ZUser',
//            'class' => 'common\core\ZWebUser',
            'identityClass' => 'app\models\Users',
            'enableAutoLogin' => true,
            'loginUrl' => '/site/login',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=zeus',
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ],
    ],
    'params' => $params,
];
